package com.queming.core.mapper;

import com.queming.core.dto.UserCreateDto;
import com.queming.core.dto.UserDto;
import com.queming.core.dto.UserUpdateDto;
import com.queming.core.entity.User;
import com.queming.core.vo.UserVo;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;

/**
 * @author 陈词调
 * @date 2022/4/17
 */
@Mapper(componentModel = "spring")

public interface UserMapper {

    UserDto toDto(User user);

    UserVo toVo(UserDto userDto);

    User createEntity(UserCreateDto userCreateDto);

    User updateEntity(@MappingTarget User user, UserUpdateDto userUpdateDto);
}
